export const setObj = (key, obj) => {
  const value = JSON.stringify(obj)
  sessionStorage.setItem(key, value)
}

export const getObj = key => {
  const value = sessionStorage.getItem(key)
  try {
    return JSON.parse(value)
  } catch (e) {
    return value
  }
}
